﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using SQLServerDataAccess;

namespace Frame.Models
{
    public class LoginModel
    {
        private DataAccess _DataAccess;
        private string _UserID;

        public LoginModel(string UserID)
        {
            _UserID = UserID;
            _DataAccess = new DataAccess();
        }

        public object GetPassword()
        {
            return _DataAccess.ExecuteScalar(new CommandExecute() { CommandText = "Select [password] From [HR_PersonDetails] Where [user_id] = @UserID And IsUse = 1", Parameters = new Dictionary<string, object>() { { "@UserID", _UserID } } });
        }

        public object GetUsername()
        {
            return _DataAccess.ExecuteScalar(new CommandExecute() { CommandText = "Select [user_name] From [HR_PersonDetails] Where [user_id] = @UserID And IsUse = 1", Parameters = new Dictionary<string, object>() { { "@UserID", _UserID } } });
        }
    }
}